<template>
    <div>
      {{JSON.stringify($store.state.storeData.user)}}
      <img :src="$store.state.storeData.user.headImgUrl" alt="">
      <span>{{$store.state.storeData.user.nickname}}</span>
      <a href="javascript:;" @click="alertTest">test</a>
    </div>
</template>
<script>
    import swal from 'sweetalert2'
    export default{
        data(){
            return {}
        },
        created() {
          http.get('/test/test.do')
            .then(data => {
                console.log(data)
            })
        },
        mounted() {

        },
        methods: {
            test:function(){
              //传递参数
              this.$router.push({path:'/home2',query:{id:1}});//类似get
            },
            login:function(){
              this.$store.commit('updateLoginState',true);
            },
            alertTest:function(){
              this.$wx.checkJsApi({
                jsApiList: [
                  'getNetworkType',
                  'previewImage'
                ],
                success: function (res) {
                  //alert(JSON.stringify(res));
                }
              });
              /*swal({
                title: '禁止提交!',
                text: '输入框未填写',
                type: 'warning',
                confirmButtonText: '确认'
              })*/
            }
        },
        components: {

        }
    }
</script>
<style scoped>

</style>
